package com.rentplant.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.rentplant.Pojo.helpcollect;
import com.rentplant.Pojo.helpcollectanduser;
import com.rentplant.mapper.helpCollectMapper;
import com.rentplant.service.helpCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class helpCollectServiceImp implements helpCollectService {

    @Autowired
    private helpCollectMapper helpcollectmapper;

    //    查询该用户是否收藏
    @Override
    public List<helpcollect> isCollect(JSONObject helpcollectinfo){
        return helpcollectmapper.isCollect(helpcollectinfo);
    }

    //收藏求租信息
    @Override
    public boolean addHelpCollect(JSONObject helpcollectinfo){
       return helpcollectmapper.addHelpCollect(helpcollectinfo);
    }

    //取消求助收藏
    @Override
    public boolean delHelpCollect(JSONObject helpcollectinfo){
        return helpcollectmapper.delHelpCollect(helpcollectinfo);
    }

    //    展示用户收藏的求租信息
    @Override
    public List<helpcollectanduser>showHelpCollect(JSONObject userinfo){
        return helpcollectmapper.showHelpCollect(userinfo);
    }

}
